import java.sql.*;
public class chazhao {
    public static void main(String args[]) {
        Connection con;
        Statement sql;
        ResultSet rs;
        con = GetDBConnection.connectDB("world","root","");
        if(con == null ) return;
        String c1=" Region Like '%Middle East%'";//条件1
        String sqlStr =
                "select * from country where "+c1;
        try {
            sql=con.createStatement();
            rs = sql.executeQuery(sqlStr);
            int sum=0;
            while(rs.next()) {
                String Number =rs.getString(7);
                sum=sum+Integer.parseInt(Number);
            }
            System.out.print("sum="+sum);
            con.close();
        }
        catch(SQLException e) {
            System.out.println(e);
        }
    }
}